<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, users-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="http://122.152.205.72:88/group1/M00/00/05/CpoxxFw_8_qAIlFXAAAcIhVPdSg994.png" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/weadmin.css}">

    <script type="text/javascript" th:src="@{/layui/layui.js}" charset="utf-8"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
<!-- 顶部开始 -->
<div class="container">
    <div class="logo">
        <a href="./index.html">HuHu v1.0</a>
    </div>
    <div class="left_open">
        <!-- <i title="展开左侧栏" class="iconfont">&#xe699;</i> -->
        <i title="展开左侧栏" class="layui-icon layui-icon-shrink-right"></i>

    </div>

    <ul class="layui-nav left" lay-filter="">
        <li class="layui-nav-item">
            <a href="javascript:;" th:utext="${loginAdmin.username}"></a>
            <dl class="layui-nav-child">
                <!-- 二级菜单 -->
                <dd>
                    <a onclick="WeAdminShow('个人信息','./pages/users/selfInfo.html')">个人信息</a>
                </dd>
                <dd>
                    <a class="loginout" id="loginOut" href="#">退出</a>
                </dd>
            </dl>
        </li>

    </ul>



</div>
<!-- 顶部结束 -->
<!-- 中部开始 -->
<!-- 左侧菜单开始 -->
<div class="left-nav">
    <div id="side-nav"></div>
</div>
<!-- 左侧菜单结束 -->

<!-- 右侧主体开始 -->
<div class="page-content">
    <div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
        <ul class="layui-tab-title" id="tabName">
            <li>欢迎界面</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
<!--                welcome.html-->
                <iframe th:src="@{/welcome}" frameborder="0" scrolling="yes" class="weIframe"></iframe>
            </div>
        </div>
    </div>
</div>
<div class="page-content-bg"></div>
<!-- 右侧主体结束 -->

<!-- 中部结束 -->

<!-- 底部开始 -->
<div class="footer" id="footer" style="display: none;">
    <div class="copyright">Copyright ©2018-2021 JM All Rights Reserved</div>
</div>
<!-- 底部结束 -->



<script type="text/javascript">

    // layui扩展模块的两种加载方式 - 示例
    // layui.extend({
    //   admin: '{/}../../static/js/admin' // {/}的意思即代表采用自有路径，即不跟随 base 路径
    // });
    // //使用拓展模块
    // layui.use('admin', function () {
    //   var admin = layui.admin;
    // });


    var showFooter = true;
    layui.config({
        base: './js/',
        version: '1.0'
    }).extend({ //设定模块别名
        admin: 'admin',
        app: 'app'
    });

    layui.use(['jquery', 'admin', 'app'], function () {
        var $ = layui.jquery,
            admin = layui.admin,
            app = layui.app;

        $(function () {
            app.getMenu();
            admin.tab.tabInit();

            if (showFooter) {
                var currentY = new Date().getFullYear();
                $('.copyright').html('Copyright ©2018-' + currentY + ' JM All Rights Reserved');
                $('#footer').show();
            } else {
                $('.left-nav, .page-content').css({ 'bottom': 0 });
                $('#footer').hide();
            }
        });
        $("#loginOut").on('click',function () {
           loginOut();
        });
        function loginOut() {
            $.ajax({
               url: '/logout',
               method:"get",
               success:function (data) {
                   if (data == 'logout'){
                       let tabtitle = $(".layui-tab-title li");
                       let ids = new Array();
                       $.each(tabtitle, function (i) {
                           ids[i] = $(this).attr("lay-id");
                       });
                       admin.tab.tabDeleteAll(ids);
                   }
                   location.href="/login"
               }
            });
        }


    });

</script>

</body>


</html>

